Repository navigation
Conversation
Fifteen commands (hug, kiss, slap, lick, pat, cuddle, poke, bite, bonk,
punch, kick, tickle, highfive, handhold, feed) post an anime GIF of the
caller doing the action to someone, built from one table in
core/action_gifs.py.
- GIFs: nekos.best first (names the anime), then otakugifs.xyz (the only
one with lick); only those hosts are posted. Every GIF fetched is
remembered (50 per action) and reused when both APIs are down; with
none, the action goes out as text. nekos.best needs a User-Agent with a
contact: the bot's name and invite link, or ACTIONS_USER_AGENT.
- A Retribuir/Revidar/Devolver button only the target can press, once.
- Counts per pair ("Ana já abraçou Bruno 5 vezes") in data/actions.db.
- Doing an action to the bot gets an answer in character through the chat
engine (ChatEngine.answer_action), costing one turn of the person's budget.
- send_action_gif tool in the chat profile: the bot does actions itself,
at most once per answer.
- Per-channel `actions` setting, shared cooldown, target pinged
(ACTIONS_PING_TARGET), self-hugs come from the bot, /help groups them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
- New actions: peck, blowkiss (airkiss fallback), nuzzle, lappillow, handshake, brofist, wave, wink, stare, cheers, pinch, yeet (27 total). - Every distinct GIF URL the APIs return is kept (the 50-per-action cap is gone). - Each GIF's file is downloaded once in the background into ACTIONS_GIFS_DIR, named by its SHA-256 so identical GIFs are stored once; two downloads at a time, only real GIFs up to 10 MiB, retried the next time the GIF is served if a download failed. - When no API answers, a stored file is uploaded as an attachment and shown in the embed (attachment://<action>.gif); then a stored URL; then text. ACTIONS_STORE_GIFS=false keeps URLs only. - .dockerignore keeps data/ out of the build context and the image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
27 roleplay commands that post an anime GIF of the caller doing the action to someone:
/hug/kiss/peck/blowkiss/pat(headpat)/cuddle/nuzzle/lappillow/handhold/handshake/highfive/brofist/wave/cheers/feed/wink/stare/lick/poke/pinch/tickle/bite/bonk/slap/punch/kick/yeet🤗 **Ana** abraçou @Bruno!with the GIF in an embed, and a footer likeAna já abraçou Bruno 5 vezes · Anime: K-On!. All commands are generated from one table incore/action_gifs.py, so adding an action is one row.How
blowkissfalls back to otakugifsairkiss;lick,nuzzle,brofist,cheers,pinchare otakugifs-only;peck,lappillow,handshake,highfive,feed,bonk,kick,yeetare nekos.best-only. Only GIFs hosted on those two sites are posted.data/action_gifs/<sha256>.gif(identical GIFs stored once; two downloads at a time; only real GIFs up to 10 MiB, Discord's upload limit; a failed download is retried the next time that GIF is served). If every source fails, a stored file is uploaded with the message and shown in the embed viaattachment://<action>.gif; then a stored URL; then text.ChatEngine.answer_action: a few words, a reaction on the GIF, an action back, or[NO_REPLY]. It costs one turn of the person'sCHAT_USER_BUDGET, replying to the answer continues the conversation, and it stays quiet whererespondisoff.send_action_giftool in the chat profile, at most once per answer, when asked ("dá um abraço no Bruno") or when it fits the personality.data/actions.db.actionssetting (/config), shared 5 s cooldown, target pinged by default, affection actions on yourself come from the bot (others refused),/helpgroups them on one line.ACTIONS_ENABLED,ACTIONS_DB_PATH,ACTIONS_STORE_GIFS,ACTIONS_GIFS_DIR,ACTIONS_PING_TARGET,ACTIONS_COOLDOWN_SECONDS,ACTIONS_BOT_REPLY,ACTIONS_TOOL_ENABLED,ACTIONS_USER_AGENT(README, SETUP.md,.env.example)..dockerignorenow excludesdata/: withCOPY . .and no ignore file, stored GIFs would otherwise go into every build context and image (Compose already mounts./data).Before deploying
ACTIONS_USER_AGENT=QuillBot (<repo or contact>)is the safe option. Until it works, the 8 nekos.best-only actions use stored files, then go out as text.hughas about 75 GIFs on nekos.best and about 23 on otakugifs (estimated from sampling), so a full set across 27 actions is likely a few thousand GIFs, a few GB indata/action_gifs/.ACTIONS_STORE_GIFS=falsekeeps URLs only.Testing
pytest: 326 passed, 27 intests/test_actions.py(providers and fallbacks, every distinct GIF kept, files saved once per content and retried, non-GIFs and oversized files refused, stored file uploaded as an attachment and shown in the embed, refused hosts, counts, wording, the return button, pings, cooldown, self-actions, the bot answering, the tool, the engine starting a conversation).ruff check .clean.nuzzle,brofist,cheers,pinch,airkiss) all returned GIFs; real files were saved and, with the APIs unreachable, a stored one was picked and attached asnuzzle.gif. Two of six parallel downloads got HTTP 428 from otakugifs' CDN and succeeded when fetched one at a time, hence the two-at-a-time limit and the retry./hugon the bot to check the question framing and the tool schema.🤖 Generated with Claude Code